package com.ruoyi.club.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.club.mapper.ClubUserRelationMapper;
import com.ruoyi.club.domain.ClubUserRelation;
import com.ruoyi.club.service.IClubUserRelationService;

/**
 * 用户-社团关联Service业务层处理
 * 
 * @author Zou
 * @date 2025-11-14
 */
@Service
public class ClubUserRelationServiceImpl implements IClubUserRelationService 
{
    @Autowired
    private ClubUserRelationMapper clubUserRelationMapper;

    /**
     * 查询用户-社团关联
     * 
     * @param id 用户-社团关联主键
     * @return 用户-社团关联
     */
    @Override
    public ClubUserRelation selectClubUserRelationById(Long id)
    {
        return clubUserRelationMapper.selectClubUserRelationById(id);
    }

    /**
     * 查询用户-社团关联列表
     * 
     * @param clubUserRelation 用户-社团关联
     * @return 用户-社团关联
     */
    @Override
    public List<ClubUserRelation> selectClubUserRelationList(ClubUserRelation clubUserRelation)
    {
        return clubUserRelationMapper.selectClubUserRelationList(clubUserRelation);
    }

    /**
     * 新增用户-社团关联
     * 
     * @param clubUserRelation 用户-社团关联
     * @return 结果
     */
    @Override
    public int insertClubUserRelation(ClubUserRelation clubUserRelation)
    {
        clubUserRelation.setCreateTime(DateUtils.getNowDate());
        return clubUserRelationMapper.insertClubUserRelation(clubUserRelation);
    }

    /**
     * 修改用户-社团关联
     * 
     * @param clubUserRelation 用户-社团关联
     * @return 结果
     */
    @Override
    public int updateClubUserRelation(ClubUserRelation clubUserRelation)
    {
        clubUserRelation.setUpdateTime(DateUtils.getNowDate());
        return clubUserRelationMapper.updateClubUserRelation(clubUserRelation);
    }

    /**
     * 批量删除用户-社团关联
     * 
     * @param ids 需要删除的用户-社团关联主键
     * @return 结果
     */
    @Override
    public int deleteClubUserRelationByIds(Long[] ids)
    {
        return clubUserRelationMapper.deleteClubUserRelationByIds(ids);
    }

    /**
     * 删除用户-社团关联信息
     * 
     * @param id 用户-社团关联主键
     * @return 结果
     */
    @Override
    public int deleteClubUserRelationById(Long id)
    {
        return clubUserRelationMapper.deleteClubUserRelationById(id);
    }
}
